import { get, getBuffer, postJson, postFile, del } from "../http";
import { query } from "../weeon/room";
let api = process.env.VUE_APP_API;
if (process.env.VUE_APP_Mock === "true") {
  api = "/mock/";
}

// 获取项目列表
// http://111.198.60.230:9501/witness/gdw/stomp
export const dvListBidInfo =  (p) =>  postJson(`${api}/witness/dv/listBidInfo`, p);

// 区域房间结构
export const dvListAreaRoom =  () =>  get(`${api}/witness/dv/listAreaRoom`);
// 获取设备列表
export const dvGetPreviewURLs=  (query) =>  get(`${api}/witness/dv/getPreviewURLs`,query);
//  获取设备列表 --新 // areaType 区域类型： 0区域、1房间
export const dvGetlistCamera=  (query) =>  get(`${api}/witness/dv/listCamera`,query)

// 获取设备播放地址url
export const dvGetPreviewURL=  (id) =>  get(`${api}/witness/dv/getPreviewURLs/${id}`)

// 根据项目查询设备
export const  dvListProjectCamera = (query) =>  get(`${api}/witness/dv/listProjectCamera`,query)

// 大屏3
// 获取人员列表

export const  dvListPerson = (query) =>  get(`${api}/witness/dv/listPerson`,query)

// 获取轨迹列表
export const  dvListTrack = (data) =>  postJson(`${api}/witness/dv/listTrack`,data)

// 获取场地占用情况 - 弃用

export const  getSiteData = (query) =>  get(`${api}/witness/dv/getSiteData`,query)
// 获取场地占用情况 - 新
export const  getSiteDataV2 = (query) =>  get(`${api}/witness/dv/getSiteDataV2`,query)

// 项目预警列表

export const  dvListAlarm = (data) =>  postJson(`${api}/witness/dv/listAlarm`,data)

// 查询工作人员列表
export const  listPersonByTrack = (data) =>  postJson(`${api}/witness/dv/listPersonByTrack` ,data)
// 获取预警详情

// 

export const dvGetAlarm = (id) => get(`${api}/witness/dv/getAlarm/`+ id)
// 获取预警地址

// 

export const getAlarmPlaybackURLs = (data) => postJson(`${api}/witness/dv/getAlarmPlaybackURLs`,data)

// 场地占用-侧边栏

// 

export const dvListBidInfoAll = (data) => postJson(`${api}/witness/dv/listBidInfoAll`,data)
// 监控视频获取历史回放


export const dvGetPlaybackURLs = (data) => postJson(`${api}/witness/dv/getPlaybackURLs`,data)

// 获取项目列表

export const pageProjectBid = (data) => postJson(`${api}/witness/dv/pageProjectBid`,data)




// 获取监控场地列表


export const dvGetCameraTree = () => get(`${api}/witness/dv/getCameraTree`)

export const dvGetSiteData = (date) => get(`${api}/witness/dv/getSiteData?date=`+date)
// 获取项目预警列表


